Skip to content

Conversation

@cary-ilm
Copy link
Member

Python3_SIETARCH is relative, but PYTHON_INSTALL_DIR is absolute. So strip the Python3_PREFIS from Python3_SITEARCH to form a relative path.

This is preferable to the current hardcoded path, but is also preferable to using an absolute path, as suggested in #523.

Python3_SIETARCH is relative, but PYTHON_INSTALL_DIR is absolute. So
strip the Python3_PREFIS from Python3_SITEARCH to form a relative path.

This is preferable to the current hardcoded path, but is also
preferable to using an absolute path, as suggested in AcademySoftwareFoundation#523.

Signed-off-by: Cary Phillips <[email protected]>
@cary-ilm cary-ilm requested a review from Copilot November 25, 2025 01:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CMake configuration to dynamically determine the Python installation directory using Python3_SITEARCH instead of hardcoded paths. The change makes the installation path relative to Python3_PREFIX, allowing for more flexible and correct Python module installation across different systems.

Key Changes:

  • Replaces hardcoded lib/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages paths with dynamically computed relative paths
  • Centralizes PYTHON_INSTALL_DIR computation in src/python/CMakeLists.txt
  • Adds fallback logic to derive Python3_PREFIX from the Python executable location when not set

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/python/CMakeLists.txt Adds logic to compute PYTHON_INSTALL_DIR as a relative path from Python3_PREFIX to Python3_SITEARCH
src/python/PyImath/CMakeLists.txt Removes local PYTHON_INSTALL_DIR computation, now relies on parent CMakeLists.txt
src/python/PyImathNumpy/CMakeLists.txt Removes local PYTHON_INSTALL_DIR computation, now relies on parent CMakeLists.txt
src/pybind11/PyBindImath/CMakeLists.txt Updates PYTHON_INSTALL_DIR computation with the new relative path logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cary-ilm cary-ilm merged commit 9830065 into AcademySoftwareFoundation:main Nov 25, 2025
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants